#!bin/bash
git reset --hard
git pull
mvn clean package -Dmaven.test.skip=true
#删除容器
if [ $(docker ps -aq --filter name=my-knowledge) ]; then
  docker rm -f my-knowledge
fi
#删除镜像
if [[ $(docker images |grep business/my-knowledge) ]]; then
  docker rmi business/my-knowledge:v1.0
fi
docker build  -t business/my-knowledge:v1.0 .
docker run --restart=always   --name my-knowledge -d -p 8113:8113 business/my-knowledge:v1.0